import React from 'react';

export class ChildB extends React.Component {
  render() {
    return (
      <div
        style={{ border: '1px solid blue', margin: '16px', padding: '16px' }}
      >
        <h2>ChildB</h2>
        <button onClick={() => this.props.setMsg('A你好')}>
          传消息到ChildA组件
        </button>
      </div>
    );
  }
}
